Exception | Description |
---|---|
System.ArgumentOutOfRangeException | left, top, right, or bottom are less than 0.0 or greater than 1.0. |
System.ArgumentException | stops contains less than two gradient stops. There must be at least two stops to define the gradient. |
The rectangular gradient is defined by specifying an inner rectangle and a set of gradient stops. The gradient goes from the edges of the inner rectangle to the edges of the cell. If the inner rectangle does not have a height or width of 0, the color of the first gradient stop will be filled in the center of the inner rectangle.
The inner rectangle is defined by the left, top, right, and bottom parameters. They are relative values ranging from 0.0 to 1.0 and they go from the top/left to the bottom/right. So, for example, to specify a gradient that goes out from the center, all values would be 0.5. Or to specify a gradient which goes out from the bottom-left corner of the cell, the following values would be used: left = 0.0, top = 1.0, right = 0.0, bottom = 1.0.
Target Platforms: Android 4.4+, iOS 8+
Development Environments: Visual Studio 2015+, Visual Studio for Mac Preview, Xamarin for Visual Studio 4.2+